package com.Ian.homework;

import java.util.Objects;

public class Student {
    int id;
    String strName;
    int iAge;

    public Student() {
    }

    public Student(int id, String strName, int iAge) {
        this.id = id;
        this.strName = strName;
        this.iAge = iAge;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getStrName() {
        return strName;
    }

    public void setStrName(String strName) {
        this.strName = strName;
    }

    public int getiAge() {
        return iAge;
    }

    public void setiAge(int iAge) {
        this.iAge = iAge;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Student)) return false;
        Student student = (Student) o;
        return getId() == student.getId() &&
                getiAge() == student.getiAge() &&
                Objects.equals(getStrName(), student.getStrName());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), getStrName(), getiAge());
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", strName='" + strName + '\'' +
                ", iAge=" + iAge +
                '}';
    }
}
